﻿/**
 * @file musicsendthread.h
 * @author tjc
 * @brief 音频数据发送线程模块
 * @version 1.0
 * @date 2024-3-1
 */

#ifndef MUSICREADTHREAD_H
#define MUSICREADTHREAD_H
#include <QObject>
#include <QThread>
#include <QFile>
#include <QFileInfo>
#include <QTcpSocket>
#include <QDebug>
//线程类，负责读取音频数据并发送
class MusicSendThread : public QThread
{
    Q_OBJECT
public:
    //音频路径 filePath
    explicit MusicSendThread(const QString &filePath, QObject *parent = nullptr);
    void setStop(bool isStop){
        this->isStop = isStop;
    }
    bool getStop(){
        return this->isStop;
    }
signals:
    void dataReady(const QByteArray &data);
protected:
    void run() override;
private:
    QString filePath;
    bool isStop=false;
};
#endif // MUSICREADTHREAD_H
